<template>
  <div class="auditClass">
    <Form ref="formAudit" :label-width="120" style="margin-top:-5px" inline>
      <Divider id="return-id" class="main">审核信息</Divider>
      <div style="width:100%;overflow:hidden">
        <div v-if="secondaryFraudInfoShow" :style="styleShow">
          <card>
            <Alert>反欺诈记录</Alert>
            <Table :data="secondaryFraudInfoData" :columns="secondaryFraudInfoColumns"size="small" stripe>
                <template slot-scope="{ row, index }" slot="fraudType">
                    <span>{{setFraudType(row.fraudType,dicData.loanFakeType)}}</span>
                </template>
            </Table>
          </card>
        </div>
        <div v-if="specialBusinessShow" :style="styleShow">
          <card>
            <Alert>贷中特殊业务申请</Alert>
            <Table :data="specialBusinessInfoData" :columns="specialBusinessInfoColumns" :show-header="false" size="small" stripe></Table>
          </card>
        </div>
      </div>
      <div v-if="backInfoShow">
        <card>
          <Alert>退件记录</Alert>
          <Table :data="backToPartnersInfoData" :columns="backToPartnersInfoColumns" :show-header="true" size="small" stripe></Table>
        </card>
      </div>
      <div>
        <card>
          <Alert>自动化审核&nbsp;&nbsp;<Button type="primary" @click="checkBtn">人工查验发票</Button></Alert>
            <Table v-bind:columns="ocrColumns" v-bind:data="ocrData" sortable="custom" ref="table">
                <template slot-scope="{row , index}" slot="result">
                    <Badge v-if="row.result=='no'" color="red"/>
                    <Badge v-if="row.result=='yes'" color="green"/>
                    <span>{{setResult(row)}}</span>
                </template>
                <template slot-scope="{row , index}" slot="remark">
                    <span v-if="checkModalData.message!=undefined&&checkModalData.message!=''&&row.ocrType=='invoiceCar'">
                        <span v-if="row.remark!=undefined && row.remark!=''"><b><font color="#4169E1">{{row.remark+'('+checkModalData.message+')'}}</font></b></span>
                    </span>
                    <span v-if="checkModalData.message==undefined||checkModalData.message==''||row.ocrType!='invoiceCar'">
                        <span v-if="row.remark!=undefined && row.remark!=''"><b><font color="#4169E1">{{row.remark}}</font></b></span>
                    </span>
                        <span v-if="row.approveOcrCompareList != undefined &&
                          row.approveOcrCompareList.size !=0"
                          v-for="(item) in row.approveOcrCompareList">
                        <span v-if="item.compareField =='invoiceAuthenticity'">
                            <span v-if="item.compareNewValue == undefined" style="color:red">{{item.compareFieldName+'('+item.compareNewValue+')'}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                            <span v-if="item.compareResult == 'no' && item.compareNewValue != undefined" style="color:red">{{item.compareFieldName+'('+item.compareNewValue+')'}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                            <span v-if="item.compareResult == 'yes' && item.compareNewValue != undefined">{{item.compareFieldName+'('+item.compareNewValue+')'}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                        </span>
                        <span v-if="item.compareField !='invoiceAuthenticity'">
                            <span v-if="item.compareResult == 'no'" style="color:red">{{item.compareFieldName}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                            <span v-if="item.compareResult == 'yes'">{{item.compareFieldName}}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                        </span>
                    </span>
                </template>
            </Table>
        </card>
      </div>
      <div>
        <card>
          <Alert>基本信息</Alert>
          <div class="child-div">
            <FormItem label="申请编号:">{{caseBaseInfoData.applyNo}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="案件提报:">{{caseBaseInfoData.passFirstDate}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="案件审批:">{{caseBaseInfoData.passLastDate}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="放款申请提交:">{{caseContractInfoData.lendingFirstDate}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="合同号码:">{{caseContractInfoData.contractNo}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="合同激活:">{{caseContractInfoData.startDate}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="合同终止:">{{caseContractInfoData.endDate}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="放款审核通过:">{{caseContractInfoData.lendingPassDate}}</FormItem>
          </div>
        </card>
      </div>
      <div>
        <card>
          <Alert>渠道信息 &nbsp;&nbsp;&nbsp;
            <b>
                渠道类型：<font color="#4169E1">{{channelBaseInfoData.channelBelong}}</font>&nbsp;&nbsp;&nbsp;
                评级：<font color="#4169E1">{{channelRiskInfoData.channelGrade}}</font>&emsp;
            </b>
          </Alert>
            <div class="child-div">
                <FormItem label="渠道/车商名称:" :label-width="120">{{channelBaseInfoData.channelFullName}}</FormItem>
            </div>
            <div class="child-div">
                <FormItem label="报单员姓名:" :label-width="120">{{caseContractInfoData.userRealName}}</FormItem>
            </div>
            <div class="long-child-div">
                <FormItem label="报单员联系方式:" :label-width="120">{{caseContractInfoData.phone}}</FormItem>
            </div>
            <div id="channelWitnessInfo" v-if="channelWitnessInfoData.id!=null&&channelWitnessInfoData.id!=''">
                    <Col span="6">
                        <FormItem label="见证人:" :label-width="120">{{channelWitnessInfoData.witnessName}}</FormItem>
                    </Col>
                    <Col span="6">
                        <FormItem label="见证人联系方式:" :label-width="120">{{channelWitnessInfoData.witnessContactNumber}}</FormItem>
                    </Col>
                    <Col span="6">
                        <FormItem label="见证人证件号:" :label-width="120">{{channelWitnessInfoData.witnessIdCard}}</FormItem>
                    </Col>
                    <Col span="6">
                        <FormItem label="见证人状态:" :label-width="120">{{channelWitnessInfoData.status}}</FormItem>
                    </Col>
                    <Col span="6">
                        <FormItem label="见证人授权有效期:" :label-width="120">{{channelWitnessInfoData.witnessValidityAuthorization}}</FormItem>
                    </Col>
            </div>
        </card>
      </div>
      <div>
        <card>
          <Alert>客户信息</Alert>
          <div class="child-div">
            <FormItem label="主借人:">{{custMainInfoData.custName}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="证件类型:">{{custMainInfoData.certType}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="证件号码:">{{custMainInfoData.certNo}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="有效期止:">
                <div v-if="custMainInfo_certEndDate_is_long">长期</div>
                <div v-else>{{custMainInfoData.certEndDate}}</div>
            </FormItem>
          </div>
          <span v-if="jointInfoDrop">
            <div class="child-div">
              <FormItem label="共借人:">{{custJointInfoData.custName}}</FormItem>
            </div>
            <div class="child-div">
              <FormItem label="证件类型:">{{custJointInfoData.certType}}</FormItem>
            </div>
            <div class="child-div">
              <FormItem label="证件号码:">{{custJointInfoData.certNo}}</FormItem>
            </div>
            <div class="child-div">
              <FormItem label="有效期止:">
                  <div v-if="jointInfo_certEndDate_is_long">长期</div>
                  <div v-else>{{custJointInfoData.certEndDate}}</div>
              </FormItem>
            </div>
          </span>
          <span v-if="guaranteeInfoDrop">
            <div class="child-div">
              <FormItem label="担保人:">{{custGuarantorInfoData.custName}}</FormItem>
            </div>
            <div class="child-div">
              <FormItem label="证件类型:">{{custGuarantorInfoData.certType}}</FormItem>
            </div>
            <div class="child-div">
              <FormItem label="证件号码:">{{custGuarantorInfoData.certNo}}</FormItem>
            </div>
            <div class="child-div">
                <FormItem label="有效期止:">
                    <div v-if="guaranteeInfo_certEndDate_is_long">长期</div>
                    <div v-else>{{custGuarantorInfoData.certEndDate}}</div>
                </FormItem>
            </div>
          </span>
          <div style="width:100%;overflow:hidden">
              <div style="display:inline-block;float:left;width:5%;">
                  <Button type="primary" @click="caseCustDropDown" ghost>{{caseCustDropDownContent}}</Button>
              </div>
              <div style="display:inline-block;float:right;width:90%;">
                  <span v-if="caseCustDrop">
                      <card>
                          <Table row-key="financeItemName" :data="caseCustHistoryListData" :columns="caseCustHistoryColumns" :show-header="true" size="small">
                              <template slot-scope="{ row }" slot="action">
                                <a style="margin-right:5px" v-if="row.custRole=='主借人' || row.custRole=='01'" v-has="'sys_dicdata_edit'" type="primary" size="small"
                                        @click="lookMainInImage(row)">查看影像资料
                                </a>
                                  <a style="margin-right:5px" v-if="row.custRole=='共借人' || row.custRole=='02'" v-has="'sys_dicdata_edit'" type="primary" size="small"
                                     @click="lookJoinInImage(row)">查看影像资料
                                </a>
                            </template>
                          </Table>
                      </card>
                  </span>
              </div>
          </div>
        </card>
      </div>
      <div>
        <card>
          <Alert>车辆信息&emsp;
            <b>
                业务类型：<font color="#4169E1">{{caseBaseInfoData.businessType}}</font>&emsp;
                车辆类型：<font color="#4169E1">{{caseBaseInfoData.carType}}</font>&emsp;
                车辆属性：<font color="#4169E1">{{caseBaseInfoData.carNature}}</font>&emsp;
                购车目的：<font color="#4169E1">{{caseBaseInfoData.carPurpose}}</font>&emsp;
                挂靠方式：<font color="#4169E1">{{caseBaseInfoData.affiliatedWayName}}</font>&emsp;
            </b></Alert>
            <div>
                <Row>
                    <Col span="6">
                        <FormItem label="品牌:">{{caseCarInfoData.brandName}}</FormItem>
                    </Col>
                    <Col span="18">
                        <FormItem label="款式:" >{{caseCarInfoData.styleName}}</FormItem>
                    </Col>
                    <Col span="6">
                        <FormItem label="车型:">{{caseCarInfoData.modelName}}</FormItem>
                    </Col>
                    <Col span="6">
                        <FormItem label="车辆型号:">{{caseCarInfoData.fullModelNum}}&nbsp;&nbsp;<Icon v-if="fullModelNumChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
                    </Col>
                    <Col span="6">
                        <FormItem v-if="!carVinCheck" label="VIN号:" style="color: #bd2c00">{{caseCarInfoData.carVin}}&nbsp;&nbsp;<Icon v-if="carVinChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
                        <FormItem v-else label="VIN号:">{{caseCarInfoData.carVin}}</FormItem>
                    </Col>
                    <Col span="6">
                        <FormItem label="发动机号:">{{caseCarInfoData.engineNo}}&nbsp;&nbsp;<Icon v-if="engineNoChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
                    </Col>
                </Row>
            </div>
        </card>
      </div>
      <div v-if="affiliatedShow">
        <card>
          <Alert>挂靠信息 &emsp;<b>
              <font color="#4169E1">{{caseBaseInfoData.affiliatedWayName}}</font>&emsp;
            </b></Alert>
          <span v-if="affiliatedDrop">
            <div class="long-child-div">
              <FormItem :label="affiliatedLabelName" :label-width="120">{{channelAffiliatedUnitsData.affiliatedName}}<Icon v-if="indBusinessNameChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
            </div>
            <div class="long-child-div">
              <FormItem label="统一社会信用代码" :label-width="120">{{channelAffiliatedUnitsData.socUniCrtCode}}<Icon v-if="indBusinessUsciChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
            </div>
          </span>
        </card>
      </div>
      <div>
        <card v-if="singleProductShow">
          <Alert>财务信息&emsp;&emsp;<b v-if="carNature ==true">
              <font color="#FF0000">最低发票价格：{{carInvoiceInfoData.invoiceMinAmt}}元</font>&emsp;
            </b></Alert>
          <div class="long-child-div">
            <FormItem label="金融产品:">{{caseBaseInfoData.productName}}</FormItem>
          </div>
          <div class="long-child-div">
            <FormItem label="开票单位:">{{carInvoiceInfoData.makeInvoiceUnit}}<Icon v-if="makeInvoiceUnitChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
          </div>
          <div class="child-div">
              <FormItem label="放款模式:" v-if="lendingMode ==true"><b><font color="#4169E1">{{caseContractInfoData.lendingMode}}</font></b><Icon v-if="lendingModeChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
              <FormItem label="放款模式:" v-if="lendingMode !=true">{{caseContractInfoData.lendingMode}}<Icon v-if="lendingModeChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
          </div>
          <div class="child-div">
            <FormItem label="资产金额:">{{costTotalInfoData.contAmt}}</FormItem>
          </div>
            <div class="child-div">
                <FormItem label="贷款金额:">{{costTotalInfoData.loanAmt}}</FormItem>
            </div>
            <div class="child-div">
                <FormItem label="首付金额:">{{costTotalInfoData.downPayAmt}}</FormItem>
            </div>
            <div class="child-div">
                <FormItem label="首付比例:">{{caseCostCarInfoData.downPayScale}}%</FormItem>
            </div>
          <div class="child-div">
            <FormItem label="车辆价格:">{{caseCostCarInfoData.contractAmt}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="附加贷金额:">{{caseCostCarInfoData.addAmt}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="月供金额:">{{costTotalInfoData.monthPayAmt}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="期数:">{{caseCostCarInfoData.loanTerm}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="客户利率:">{{caseCostCarInfoData.custRate}}%</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="补贴利率:">{{caseCostCarInfoData.discountRate}}%</FormItem>
          </div>
          <div class="child-div" v-if="structureMonthPayAmtShow">
            <FormItem label="结构性月供:">{{costTotalInfoData.monthPayAmt}}</FormItem>
          </div>
          <div class="child-div">
            <FormItem label="尾付金额:">{{costTotalInfoData.tailPayAmt}}</FormItem>
          </div>
            <div class="child-div">
                <FormItem label="利息总额:">{{costTotalInfoData.interestAmt}}</FormItem>
            </div>
          <div class="child-div">
            <FormItem label="贴息金额:">{{costTotalInfoData.subsidyTotalAmt}}</FormItem>
          </div>
          <div style="width:100%;overflow:hidden">
            <div style="display:inline-block;float:left;width:5%;">
              <Button type="primary" @click="financingItemsDropDown" ghost>{{financingItemsDropDownContent}}</Button>
            </div>
            <div style="display:inline-block;float:right;width:90%;">
              <span v-if="financingItemsDrop">
                <card>
                  <Table row-key="financeItemName" :data="addedFinancingItemsData" :columns="addedFinancingItemsColumns" :show-header="false" size="small"></Table>
                </card>
              </span>
            </div>
          </div>
        </card>
          <card v-if="multipleProductShow">
              <div id="v1">
                  <Alert id="f1">财务信息&emsp;&emsp;<b>
                      <font color="#FF0000">最低发票价格：{{carInvoiceInfoData.invoiceMinAmt}}元</font>&emsp;
                  </b></Alert>
                  <Row>
                      <Col span="6">
                          <FormItem label="金融产品:">{{caseBaseInfoData.productName}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="开票单位:">{{carInvoiceInfoData.makeInvoiceUnit}}<Icon v-if="makeInvoiceUnitChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
                      </Col>
                      <Col span="6" >
                          <FormItem label="放款模式:" v-if="lendingMode ==true"><b><font color="#4169E1">{{caseContractInfoData.lendingMode}}</font></b><Icon v-if="lendingModeChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
                          <FormItem label="放款模式:" v-if="lendingMode !=true">{{caseContractInfoData.lendingMode}}<Icon v-if="lendingModeChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="资产金额:">{{costTotalInfoData.contAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="贷款总额:">{{costTotalInfoData.loanAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="首付总额:">{{costTotalInfoData.downPayAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="首期月供总额:">{{costTotalInfoData.monthPayAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="尾付总额:">{{costTotalInfoData.tailPayAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="利息总额:">{{costTotalInfoData.interestAmt}}</FormItem>
                      </Col>
                  </Row>
              </div>
              <div>
                  <Alert id="f2">车款信息</Alert>
                  <Row>
                      <Col span="6">
                          <FormItem label="车辆价格:">{{caseCostCarInfoData.contractAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="首付比例:">{{caseCostCarInfoData.downPayScale}}%</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="首付金额:">{{caseCostCarInfoData.downPayAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="期数:">{{caseCostCarInfoData.loanTerm}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="首期月供:">{{caseCostCarInfoData.monthPayAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="贷款金额:">{{caseCostCarInfoData.loanAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="还款频率:">月付</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="客户利率:">{{caseCostCarInfoData.custRate}}%</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="利息总额:">{{caseCostCarInfoData.totalInterest}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="贴息方式:">{{caseCostCarInfoData.discountType}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="贴息金额:">{{caseCostCarInfoData.discountAmt}}</FormItem>
                      </Col>
                  </Row>
              </div>
              <div>
                  <Alert id="f3">附加贷</Alert>
                  <Row>
                      <Col span="6">
                          <FormItem label="附加贷金额:">{{caseCostOtherInfoData.contractAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="首付比例:">{{caseCostOtherInfoData.downPayScale}}%</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="首付金额:">{{caseCostOtherInfoData.downPayAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="期数:">{{caseCostOtherInfoData.loanTerm}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="首期月供:">{{caseCostOtherInfoData.monthPayAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="贷款金额:">{{caseCostOtherInfoData.loanAmt}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="还款频率:">月付</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="客户利率:">{{caseCostOtherInfoData.custRate}}%</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="利息总额:">{{caseCostOtherInfoData.totalInterest}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="贴息方式:">{{caseCostOtherInfoData.discountType}}</FormItem>
                      </Col>
                      <Col span="6">
                          <FormItem label="贴息金额:">{{caseCostOtherInfoData.discountAmt}}</FormItem>
                      </Col>
                  </Row>
              </div>
              <div style="width:100%;overflow:hidden">
                  <div style="display:inline-block;float:left;width:5%;">
                      <Button type="primary" @click="financingItemsDropDown" ghost>{{financingItemsDropDownContent}}</Button>
                  </div>
                  <div style="display:inline-block;float:right;width:90%;">
              <span v-if="financingItemsDrop">
                <card>
                  <Table row-key="financeItemName" :data="addedFinancingItemsData" :columns="addedFinancingItemsColumns" :show-header="false" size="small"></Table>
                </card>
              </span>
                  </div>
              </div>
          </card>
      </div>
      <div>
        <card>
            <Alert>保险信息<b v-if="insuranceInfoData.insuranceMode=='electronics'">&emsp;<font color="#4169E1">{{translationDic(this.dicData.insuranceMode,insuranceInfoData.insuranceMode)}} </font></b>&emsp;
            <span v-if="paperInfoDrop">
              <Button type="primary" @click="paperDateBtn" style="float:right;margin: -3px;">保存</Button>
            </span>
            <span v-if="electronicInfoDrop">
              <Button type="primary" @click="dropDown" style="float:right;margin: -3px;">{{dropDownContent}}</Button>
            </span>
          </Alert>
          <span v-if="paperInfoDrop">
            <div class="child-div">
              <FormItem label="保单生效日期:">
                <DatePicker v-model="insuranceInfoData.insuranceStartTime" @on-change="changeData" format="yyyy年MM月dd日" type="date" placeholder="请选择日期" />
              </FormItem>
            </div>
            <div class="child-div">
              <FormItem label="保单失效日期:">
                <DatePicker v-model="insuranceInfoData.insuranceEndTime" format="yyyy年MM月dd日" type="date" placeholder="请选择日期" />
              </FormItem>
            </div>
          </span>
          <span v-if="electronicInfoDrop">
            <Table :data="electronicDetailInfoData" :columns="electronicDetailInfoColumns" :show-header="true" size="small" stripe></Table>
          </span>
          <span v-if="drop">
            <div style="display:inline-block;float:left;width:97%;">
              <card disabled="true">
                <Table :data="electronicInfoData" :columns="electronicInfoColumns" :show-header="true" size="small" stripe></Table>
                <font color="#FF0000"><b>保单特别约定</b></font><br>
                天津长城滨银汽车金融有限公司为本保单优先受偿人，车辆出险后单词理赔金额在10000元（含）以上时，保险人需依照优先受偿人书面指示进行赔付。本保单未经优先受偿人书面同意，不得被退保，减保或批改（批改车辆牌照除外）。<br><br>
                1.医疗费用按照保险事故发生地医保用药范围赔付，需进行伤残鉴定的，应在共同协商的基础上委托河南省司法厅认可的取得伤残鉴定资质的单位进行，未经协商单方鉴定的（包括被保险人单方认可受害人提供的鉴定结论），保险人有权重新核定。<br>
                2.若车牌号牌、发动机号、车架号、初登日期等信息与行驶证或实际不符，为非被保险车辆，保险人不负赔偿责任。<br><br>
                <b>
                  关注“PICC河南人保”微信公众号，保单有效期内，9座及以下家庭自用车客户可免费享受我司提供的河南省地市市区及部分县城城区的代为驾驶服务2次，每次不超过15公里.<br>
                  关注“PICC河南人保”微信公众号，保单有效期内，9座及以下投保商业车险的家庭自用汽车客户，被保险车辆在使用过程中发生故障不能正常行驶，可免费享受不限次数，每次100公里范围内的道路故障救援服务（服务内容含拖车、送水、送防冻液、搭电、更换轮胎、拖拽）
                </b>
              </card>
            </div>
          </span>
        </card>
      </div>
      <div>
        <card>
          <Alert>还款信息&emsp;<b>
              <font color="#4169E1">{{loanBankCardInfoData.authorizeWay}}</font>
            </b></Alert>
          <div class="child-div">
            <FormItem label="还款卡银行:">{{loanBankCardInfoData.bankCode}}<Icon v-if="bankCodeChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
          </div>
          <div class="child-div">
            <FormItem label="开户人:">{{loanBankCardInfoData.accountName}}<Icon v-if="accountNameChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
          </div>
          <div class="child-div">
            <FormItem label="还款卡号:">{{loanBankCardInfoData.accountNo}}<Icon v-if="accountNoChanged" type="md-warning" color="#FF9900" size="18"/></FormItem>
          </div>
            <div class="child-div">
                <FormItem label="开卡省市:">
                    {{getAddressTitle(loanBankCardInfoData.openAddressTemp,provinceList)}}<Icon v-if="openCityChanged" type="md-warning" color="#FF9900" size="18"/>
                </FormItem>
            </div>
          <span v-if="bankDrop">
            <div class="child-div">
              <FormItem label="银行卡预留手机号码:" :label-width="130">{{loanBankCardInfoData.bankPhone}}</FormItem>
            </div>
            <div class="child-div">
              <FormItem label="签约结果:">{{loanBankCardInfoData.verStatus}}</FormItem>
            </div>
          </span>
        </card>
      </div>
      <div>
        <card>
          <Alert>备注</Alert>
          <div style="text-align: center;">
            <Input type="textarea" style="
            width:500px" :rows="6" @on-blur="getRemark" v-model="remarks" />
          </div>
        </card>
      </div>
    </Form>
    <Modal v-model="checkInvoiceVisible" ref="checkInvoiceModel" :label-width="80" :title="modalTitle" :closable="false" :mask-closable='false' :width="600" :styles="{top: '180px'}">
      <div slot="footer">
        <Button type="text" @click="cancelInvoice">取消</Button>
        <Button type="primary" @click="submitInvoice">提交</Button>
      </div>
      <Row>
        <Form ref="checkInvoiceForm" :model="checkInvoiceForm" inline :label-width="80" class="search-form" :rules="formValidate">
          <Form-item label="发票代码" prop="invoiceCode">
            <Input type="text" v-model="checkInvoiceForm.invoiceCode" clearable placeholder="请输入" style="width: 150px;height: 50px;" />
          </Form-item>
          <Form-item label="发票号码" prop="invoiceNumber">
            <Input type="text" v-model="checkInvoiceForm.invoiceNumber" clearable placeholder="请输入" style="width: 150px;height: 50px;" />
          </Form-item>
          <Form-item label="开票日期" prop="invoiceDate">
            <DatePicker v-model="checkInvoiceForm.invoiceDate" type="date" format="yyyy-MM-dd HH:mm:ss" clearable placeholder="请选择时间" style="width: 150px"></DatePicker>
          </Form-item>
          <Form-item label="不含税价" prop="invoiceAmt">
            <Input type="text" v-model="checkInvoiceForm.invoiceAmt" clearable placeholder="请输入" style="width: 150px;height: 50px;" />
          </Form-item>
        </Form>
      </Row>
    </Modal>
    <Modal v-model="imageModalVisible" width="1000px" :styles="{top: '20px'}">
        <div class="imageModalVisible">
            <ImagePreview :access="access" :codes="uniqueCodes" :busiNo="busiNo" :belongNo="belongNo" :isInit="isView" :path="path"></ImagePreview>
        </div>

    </Modal>
    <Spin size="large" fix v-if="spinShow"></Spin>
  </div>
</template>
<script>
import {
  getAllLoanInfo,
  getInvoice,
  getInvoiceCheck,
  savePaperInfo,
    getAddressTree,
    getOcrResult,
    getVinCarCheck
} from '_p/afs-core-business/api/afs-case/loan-approve/loanAuditDetail'
import { getByTypes } from '_p/basic/api/admin/datadic'
import ImagePreview from "../../../../../basic/pages/image/file-audit/view/imagePreview";

export default {
  name: 'loan-Audit-Detail',
  components: {
      ImagePreview
  },
  props: {
    detailParams: {},
  },
  data() {
    return {
      remarks: '',
      affiliatedLabelName: '公司名称',
      spinShow: false,
      drop: false,
      dropDownContent: '点击展开',
      dropDownIcon: 'ios-arrow-down',
      styleShow: '',
      secondaryFraudInfoShow: false,
      lendingMode:false,
      specialBusinessShow: false,
      backInfoShow: false,
      carVinCheck: false,
      imageModalVisible: false,
      financingItemsDrop: false,
      caseCustDrop: false,
      jointInfoDrop: false,
      guaranteeInfoDrop: false,
      checkInvoiceVisible: false,
      paperInfoDrop: false,
      electronicInfoDrop: false,
      bankDrop: false,
      affiliatedDrop: false,
        singleProductShow:true,
        multipleProductShow:false,
        structureMonthPayAmtShow:false,
      checkModalData: {},
      checkInvoiceForm: {},
      modalTitle: '',
      financingItemsDropDownContent: '点击展开',
      financingItemsDropDownIcon: 'ios-arrow-down',
      caseCustDropDownContent: '点击展开',
      caseCustDropDownIcon: 'ios-arrow-down',
      invoiceAmt: 0,
      invoiceMinAmt:0,
      dicData: [],
      secondaryFraudInfoData: [],
      caseCustHistoryListData: [],
      backToPartnersInfoData: [],
      specialBusinessInfoData: [],
      caseBaseInfoData: {},
      caseContractInfoData: {},
      channelBaseInfoData: {},
      channelWitnessInfoData: {},
      channelRiskInfoData: {},
      custMainInfoData: {},
      custJointInfoData: {},
      custGuarantorInfoData: {},
      caseCarInfoData: {},
      insuranceInfoData: {},
      carInvoiceInfoData: {},
        carNature:false,
        fullModelNumChanged:false,
        carVinChanged:false,
        engineNoChanged:false,
        indBusinessNameChanged:false,
        indBusinessUsciChanged:false,
        lendingModeChanged:false,
        bankCodeChanged:false,
        openCityChanged:false,
        accountNoChanged:false,
        makeInvoiceUnitChanged:false,
        accountNameChanged:false,
      channelAffiliatedUnitsData: {},
        affiliatedShow:true,
        caseCostCarInfoData: {
          loanAmt: 0,
        }, //车款
        caseCostOtherInfoData: {
        loanAmt: 0,
      }, //附加贷
      costTotalInfoData: {}, //总费用信息
      provinceList:[],
      custMainInfo_certEndDate_is_long: false,
      jointInfo_certEndDate_is_long: false,
      guaranteeInfo_certEndDate_is_long: false,
        addedFinancingItemsData: [],
        caseCustHistoryColumns:[
            {
                title: "操作",
                key: "action",
                width: 160,
                align: "center",
                slot: 'action'
            },
            {
                title: "客户姓名",
                key: "custName",
                width: 160,
            },
            {
                title: "变更主体",
                key: "custRole",
                width: 160,
            },
            {
                title: "证件号码",
                key: "certNo",
                minWidth: 120,
            },
            {
                title: "证件到期日",
                key: "certEndDate",
                minWidth: 120,
            },
            {
                title: "证件到期日（新）",
                key: "newCertEndDate",
                minWidth: 120,
            }
        ],
        ocrColumns:[
            {
                title: "校验类型",
                key: "checkType",
                width: 160,
            },
            {
                title: "比对结果",
                key: "result",
                width: 160,
                slot: "result"
            },
            {
                title: "比对明细",
                key: "remark",
                minWidth: 120,
                slot: "remark"
            }
        ],
        ocrData:[
            {
                checkType: '发票校验',
                ocrType: 'invoiceCar',
                result: '',
                remark: ''
            },
            {
                checkType: '还款人身份证',
                ocrType: 'idCardt',
                result: '',
                remark: ''
            },
            {
                checkType: '还款人银行卡',
                ocrType: 'bankCard',
                result: '',
                remark: ''
            },
        ],
        addedFinancingItemsColumns: [
            {
                title: '附加产品',
                key: 'financeItemName',
                tree: true,
                render: (h, params) => {
                    return h('span', '附加产品: ' + (params.row.financeItemName || ''))
                },
            },
            {
                title: '金额',
                key: 'applyFinanceItemAmt',
                render: (h, params) => {
                    return h('span', '金额: ' + (params.row.applyFinanceItemAmt))
                },
            },
            {
                title: '实际成交价格',
                key: 'addFinanceAmt',
                render: (h, params) => {
                    if(params.row.addFinanceAmt!=null){
                        if(params.row.qualified==false){
                            return h('span', [
                                h('span', '实际成交价格：'),
                                h('span', {
                                    style: {
                                        color: 'red'
                                    }
                                },params.row.addFinanceAmt)
                            ]);
                        }else {
                            return h('span', [
                                h('span', '实际成交价格：'),
                                h('span',params.row.addFinanceAmt)
                            ]);
                        }
                    }
                },
            },
        ],
      electronicDetailInfoData: [],
      electronicDetailInfoColumns: [
        {
          title: '保险公司',
          align: 'center',
          key: 'insuranceCompany',
        },
        {
          title: '被保险人',
          align: 'center',
          key: 'businessName',
        },
        {
          title: '车架号',
          align: 'center',
          key: 'carVin',
        },
        {
          title: '机动车损失险',
          align: 'center',
          key: 'vehicleLossAmt',
        },
        {
          title: '盗抢险',
          align: 'center',
          key: 'theftAmt',
        },
        {
          title: '第三者责任险',
          align: 'center',
          key: 'thirdPartyAmt',
        },
        {
          title: '使用性质',
          align: 'center',
          key: 'purpose',
        },
        {
          title: '保险开始时间',
          align: 'center',
          key: 'insuranceStartTime',
        },
        {
          title: '保险结束时间',
          align: 'center',
          key: 'insuranceEndTime',
        },
        {
          title: '保险有效期',
          align: 'center',
          key: 'isExpirationDate',
        },
      ],
      electronicInfoData: [],
      electronicInfoColumns: [
        {
          title: '交强险信息',
          align: 'center',
          key: 'fileType',
          children: [
            {
              title: '交强险被保险人',
              align: 'center',
              key: 'compulsoryName',
            },
            {
              title: '被保险人证件号',
              align: 'center',
              key: 'compulsoryCustNo',
            },
            {
              title: '交强险保险费',
              align: 'center',
              key: 'compulsoryAmt',
            },
            {
              title: '车船税',
              align: 'center',
              key: 'vehicleVesselTaxAmt',
            },
            {
              title: '交强险合计',
              align: 'center',
              key: 'compulsoryTotal',
            },
          ],
        },
        {
          title: '商业险保费',
          align: 'center',
          key: 'businessAmt',
        },
        {
          title: '合计',
          align: 'center',
          key: 'total',
        },
        {
          title: '保费情况',
          align: 'center',
          key: 'premiumIsMeet',
        },
      ],
      loanBankCardInfoData: {},
      channelAffiliatedUnitsColumns: [
        {
          title: '校验类型',
          key: 'busiType',
          width: 150,
        },
        {
          title: '审核状态',
          key: 'socUniCrtCode',
          width: 150,
          render: (h, params) => {
            const row = params.row
            const color = params.row.socUniCrtCode == '1' ? 'success' : 'error'
            const text = params.row.socUniCrtCode == '1' ? '通过' : '失败'
            return h(
              'Tag',
              { props: { type: 'dot', color: color, opacity: 0.2 } },
              text
            )
          },
        },
        {
          title: '审核明细',
          key: 'desc',
        },
      ],
      secondaryFraudInfoColumns: [
        {
          title: '欺诈类型',
          key: 'fraudType',
            slot:"fraudType"
        },
        {
          title: '合作商是否参与',
          key: 'isParticipation',
          render: (h, params) => {
            const text =
              params.row.isParticipation == 'yes' ? '是' : '否'
            return h('Tag', text)
          },
        },
        {
          title: '创建时间',
          key: 'createTime',
        },
          {
              title: '详情描述',
              key: 'fraudDetail',
          },
      ],
      backToPartnersInfoColumns: [
        {
          title: '文件类型',
          key: 'fileTypeName',
        },
        {
          title: '问题描述',
          key: 'backWords',
        },
        {
          title: '退件时间',
          key: 'backTime',
        },
      ],
        uniqueCodes:"",
        isView:false,
        busiNo:"",
        belongNo:"",
        access:"code",
        path:"case",
      formValidate: {},
      invoiceOcrDiscernForm: {},
    }
  },
  methods: {
    //数据字典翻译
    initSelectData() {
      let arr = [
        'bankCode',
        'lendingMode',
        'certType',
        'channelStatus',
        'channelGrade',
        'businessType',
        'custRole',
        'carType',
        'carNature',
        'carPurpose',
        'operateWay',
        'affiliatedWay',
        'authorizeWay',
         'fraudType',
         'discountCategory',
         'insuranceMode',
          'loanFakeType',
          'channelBelong',
      ]
      getByTypes(arr).then((res) => {
        if (res.code === '0000') {
          this.dicData = res.data
        }
      })
    },
    //数据字典查询
    translationDic(type, key) {
      let dic = {}
      if(!type) return ;
      type.forEach((column) => {
        if (column.value === key) {
          dic = column;
        }
      })
      return dic.title
    },
      getRemark(){
        this.$emit("getRemarks",this.remarks)
      },
     setFraudType(key,fraudType){
         let dic = {}
         fraudType.forEach(d=>{
             if(d.value==key){
                 dic=d;
             }
         })
         return dic.title
     },
      setResult(val){
        if(val.result =='no'  && val.remark != undefined && val.remark != ''){
            return "识别失败"
        }
        if(val.result == 'no' && val.remark == undefined){
            return "比对失败"
        }
        if(val.result == 'yes'){
            return "成功"
        }
      },
      setRemark(val){
        if(val!=undefined){
            val.forEach()
        }
      },
      getAddressTree() {
          getAddressTree().then(res => {
              if (res.code === "0000") {
                  if(res.data){
                      this.provinceList=res.data[0].children
                  }
              }
          })
      },
      getAddressTitle(addrValues,provinceList){
        let addrTitle="";
          if(addrValues!=undefined&&addrValues.length>0) {
              provinceList.forEach(province => {
                  if (province.value === addrValues[0]) {
                      addrTitle = addrTitle + province.label;
                      province.children.forEach(city => {
                          if (city.value === addrValues[1]) {
                              addrTitle = addrTitle + city.label;
                          }
                      })
                  }
              })
              return addrTitle;
          }
      },

    initAllData() {
      let param = this.detailParams
      getAllLoanInfo(param).then((res) => {
        if (res.code === '0000' && res.data) {
          //反欺诈信息
          this.secondaryFraudInfoData = res.data.loanSecondaryFraudInfo || []
          if (
            this.secondaryFraudInfoData &&
            this.secondaryFraudInfoData != ''
          ) {
            this.secondaryFraudInfoShow = true
          }
          //贷中特殊业务申请
          this.specialBusinessInfoData = res.data.loanSpecialBusinessInfo || []
          if (
            this.specialBusinessInfoData &&
            this.specialBusinessInfoData != ''
          ) {
            this.specialBusinessShow = true
          }
          //退件信息
          this.backToPartnersInfoData = res.data.caseBackToPartnersInfo || []
          if (
            this.backToPartnersInfoData &&
            this.backToPartnersInfoData != ''
          ) {
            this.backInfoShow = true
          }
          if(this.secondaryFraudInfoData.length>0&&this.specialBusinessInfoData.length>0){
              this.styleShow = 'display:inline-block;width:49%;'
          }else{
              this.styleShow = 'display:inline-block;float:left;width:100%;'
          }
          //基础信息
          this.caseBaseInfoData = res.data.caseBaseInfo || {}
            if(this.caseBaseInfoData.affiliatedWay==="00" || this.caseBaseInfoData.affiliatedWay == null|| this.caseBaseInfoData.affiliatedWay == undefined){
                this.affiliatedShow=false;
            }
            if(this.caseBaseInfoData.affiliatedWay){
                this.caseBaseInfoData.affiliatedWayName = this.translationDic(
                    this.dicData.affiliatedWay,
                    this.caseBaseInfoData.affiliatedWay
                )
            }
          //合同信息
          this.caseContractInfoData = res.data.caseContractInfo || {}
          if(res.data.caseContractInfo.lendingMode=='01'){
              this.lendingMode = true;
          }
          //渠道信息
          this.channelBaseInfoData = res.data.channelBaseInfo || {}
            this.channelBaseInfoData.channelBelong = this.translationDic(
                this.dicData.channelBelong,
                this.channelBaseInfoData.channelBelong
            )

          console.log(this.channelBaseInfoData,"this.channelBaseInfoData")
          //渠道评分信息
          this.channelRiskInfoData = res.data.channelRiskInfo || {}
            this.channelRiskInfoData.channelGrade = this.translationDic(
                this.dicData.channelGrade,
                this.channelRiskInfoData.channelGrade
            )
            this.channelRiskInfoData.businessType = this.translationDic(
                this.dicData.businessType,
                this.channelRiskInfoData.businessType
            )
          console.log(this.channelRiskInfoData,"this.channelRiskInfoData")
          //见证人信息
          this.channelWitnessInfoData = res.data.channelWitnessInfo || {}
          //客户信息
          res.data.caseCustInfo.forEach((e) => {
            if (e.custRole === '01') {
              //主借人
              this.custMainInfoData = e || []
                if (this.custMainInfoData.certEndDate === '2099-12-31' || this.custMainInfoData.certEndDate === '9999-12-31'){
                    this.custMainInfo_certEndDate_is_long = true;
                }
            } else if (e.custRole === '02') {
              //共借人
              this.jointInfoDrop = true
              this.custJointInfoData = e || []
                if (this.custJointInfoData.certEndDate === '2099-12-31'|| this.custJointInfoData.certEndDate === '9999-12-31'){
                    this.jointInfo_certEndDate_is_long = true;
                }
            } else if (e.custRole === '03') {
              //担保人
              this.guaranteeInfoDrop = true
              this.custGuarantorInfoData = e || []
                if (this.custGuarantorInfoData.certEndDate === '2099-12-31'|| this.custGuarantorInfoData.certEndDate === '9999-12-31'){
                    this.guaranteeInfo_certEndDate_is_long = true;
                }
            }
          })
            //变更身份证记录
            this.caseCustHistoryListData = res.data.caseCustHistorys || []
            if(this.caseCustHistoryListData.length>0){
                this.caseCustDrop=true;
                this.caseCustDropDownContent = '点击收起'
                this.caseCustDropDownIcon = 'ios-arrow-up'
            }else{
                this.caseCustDrop=false;
                this.caseCustDropDownContent = '点击展开'
                this.caseCustDropDownIcon = 'ios-arrow-down'
            }
            this.caseCustHistoryListData.forEach(caseCustHistory=>{
                if (caseCustHistory.custRole === '01') {
                    //主借人
                    if (caseCustHistory.certEndDate === '2099-12-31' || caseCustHistory.certEndDate === '9999-12-31'){
                        caseCustHistory.certEndDate = "长期"
                    }
                } else if (caseCustHistory.custRole === '02') {
                    //共借人
                    if (caseCustHistory.certEndDate === '2099-12-31'|| caseCustHistory.certEndDate === '9999-12-31'){
                        caseCustHistory.certEndDate = "长期"
                    }
                }
                if(caseCustHistory.custRole=='01'){
                    if(this.custMainInfo_certEndDate_is_long){
                        caseCustHistory.newCertEndDate = "长期"
                    } else{
                        caseCustHistory.newCertEndDate = this.custMainInfoData.certEndDate
                    }
                }
                if(caseCustHistory.custRole=='02'){
                    if(this.jointInfo_certEndDate_is_long){
                        caseCustHistory.newCertEndDate = "长期"
                    } else{
                        caseCustHistory.newCertEndDate = this.custJointInfoData.certEndDate
                    }
                }
                caseCustHistory.custRole = this.translationDic(
                    this.dicData.custRole,
                    caseCustHistory.custRole
                )
            })
          //车辆信息
          this.caseCarInfoData = res.data.caseCarInfo || {}
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.fullModelNum!=='undefined'){
                this.fullModelNumChanged=true;
            }
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.carVin!=='undefined'){
                this.carVinChanged=true;
            }
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.engineNo!=='undefined'){
                this.engineNoChanged=true;
            }
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.indBusinessName!=='undefined'){
                this.indBusinessNameChanged=true;
            }
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.indBusinessUsci!=='undefined'){
                this.indBusinessUsciChanged=true;
            }
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.lendingMode!=='undefined'){
                this.lendingModeChanged=true;
            }
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.bankCode!=='undefined'){
                this.bankCodeChanged=true;
            }
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.openCity!=='undefined'){
                this.openCityChanged=true;
            }
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.accountNo!=='undefined'){
                this.accountNoChanged=true;
            }
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.makeInvoiceUnit!=='undefined'){
                this.makeInvoiceUnitChanged=true;
            }
            if(typeof this.caseCarInfoData.changeMap!=='undefined'&&typeof this.caseCarInfoData.changeMap.accountName!=='undefined'){
                this.accountNameChanged=true;
            }
          //费用信息（）
          res.data.finCostInfo.forEach((e) => {
              e.lendingMode = this.translationDic(
                  this.dicData.lendingMode,
                  e.lendingMode
              )
              e.discountType = this.translationDic(
                  this.dicData.discountCategory,
                  e.discountType
              )
            if (e.costType === '01') {
              //车款
              this.caseCostCarInfoData = e ||{}
            } else if (e.costType === '02') {
              //附加贷款
              this.caseCostOtherInfoData = e || {}
            }
          })
          //挂靠信息
          this.channelAffiliatedUnitsData =
            res.data.channelAffiliatedUnits || {}
          //纸质保单
          this.insuranceInfoData = res.data.carInsuranceInfo || {}
          if (this.insuranceInfoData.insuranceMode === 'paper') {
            this.paperInfoDrop = true
          } else if (this.insuranceInfoData.insuranceMode === 'electronics') {
            this.electronicInfoDrop = true
          }
          //电子保单
          this.electronicInfoData = res.data.electronicsInsuraronicsInsuranceInfo || []
          this.electronicDetailInfoData = res.data.electronicsInsuranceInfo || []

          //发票信息
          this.carInvoiceInfoData = res.data.carInvoiceInfo || {}
          //银行卡信息
          this.loanBankCardInfoData = res.data.loanBankCardInfo || {}
          if (
            this.loanBankCardInfoData.authorizeWay &&
            this.loanBankCardInfoData.authorizeWay === 'online'
          ) {
            this.bankDrop = !this.bankDrop
          }
          //费用信息合并（车款+附加贷款）
          this.costTotalInfoData = res.data.caseCostInfoVO || {}
          if(this.costTotalInfoData.sameProduct==true){
              this.multipleProductShow=false;
              this.singleProductShow=true;
          }else{
              this.multipleProductShow=true;
              this.singleProductShow=false;
          }
          //附加贷项目
            this.addedFinancingItemsData = res.data.addedFinancingItems || {}
          if(this.addedFinancingItemsData.length>0){
              this.financingItemsDrop=true;
              this.financingItemsDropDownContent = '点击收起'
              this.financingItemsDropDownIcon = 'ios-arrow-up'
          }else{
              this.financingItemsDrop=false;
              this.financingItemsDropDownContent = '点击展开'
              this.financingItemsDropDownIcon = 'ios-arrow-down'
          }
          //通过字典翻译中文
          this.caseContractInfoData.lendingMode = this.translationDic(
            this.dicData.lendingMode,
            this.caseContractInfoData.lendingMode
          )
          this.loanBankCardInfoData.bankCode = this.translationDic(
            this.dicData.bankCode,
            this.loanBankCardInfoData.bankCode
          )
          this.custMainInfoData.certType = this.translationDic(
            this.dicData.certType,
            this.custMainInfoData.certType
          )
          this.custJointInfoData.certType = this.translationDic(
            this.dicData.certType,
            this.custJointInfoData.certType
          )
          this.custGuarantorInfoData.certType = this.translationDic(
            this.dicData.certType,
            this.custGuarantorInfoData.certType
          )
          this.channelWitnessInfoData.status = this.translationDic(
            this.dicData.channelStatus,
            this.channelWitnessInfoData.status
          )
          this.caseBaseInfoData.businessType = this.translationDic(
            this.dicData.businessType,
            this.caseBaseInfoData.businessType
          )
          this.caseBaseInfoData.carType = this.translationDic(
            this.dicData.carType,
            this.caseBaseInfoData.carType
          )
          if(this.caseBaseInfoData.carNature =='01' || this.caseBaseInfoData.carNature =='02'){
              this.carNature = true;
          }
          this.caseBaseInfoData.carNature = this.translationDic(
            this.dicData.carNature,
            this.caseBaseInfoData.carNature
          )
          this.caseBaseInfoData.carPurpose = this.translationDic(
            this.dicData.carPurpose,
            this.caseBaseInfoData.carPurpose
          )
          this.caseBaseInfoData.operateWay = this.translationDic(
            this.dicData.operateWay,
            this.caseBaseInfoData.operateWay
          )
          if (this.caseCarInfoData.affiliatedType) {
            this.caseCarInfoData.affiliatedType = this.translationDic(
              this.dicData.affiliatedWay,
              this.caseCarInfoData.affiliatedType
            )
            this.affiliatedDrop = !this.affiliatedDrop
              if(this.caseBaseInfoData.affiliatedWay == '00'){
                  this.affiliatedLabelName = '';
              }else if (this.caseBaseInfoData.affiliatedWay == '01') {
                  this.affiliatedLabelName = '公司名称';
              }else if (this.caseBaseInfoData.affiliatedWay == '02') {
                  this.affiliatedLabelName = '个体工商户名称';
              }else if(this.caseBaseInfoData.affiliatedWay == '03') {
                  this.affiliatedLabelName = '网约车平台';
              }else {
                  this.affiliatedLabelName = '';
              }
          } else {
            this.caseCarInfoData.affiliatedType = '无'
          }
          if(this.loanBankCardInfoData.authorizeWay!='offline'){
              this.loanBankCardInfoData.authorizeWay = this.translationDic(
                  this.dicData.authorizeWay,
                  this.loanBankCardInfoData.authorizeWay
              )
          } else {
              this.loanBankCardInfoData.authorizeWay=''
          }
        }
        getVinCarCheck(this.caseCarInfoData.carVin).then(res=>{
            if(res.code=='0000'){
                this.carVinCheck = res.data;
            }
        })
      })
    },
      changeData() {
          // 处理保险信息的结束日期不能早于开始日期，默认间隔一年，可修改
          if (this.insuranceInfoData.insuranceStartTime != "") {
              this.insuranceInfoData.insuranceEndTime = this.getTime(this.insuranceInfoData.insuranceStartTime);
          }
      },
      getTime(v) {
          var year = v.getFullYear() + 1; //年 ,从 Date 对象以四位数字返回年份
          var month = v.getMonth() + 1; //月 ,从 Date 对象返回月份 (0 ~ 11) ,date.getMonth()比实际月份少 1 个月
          var day = v.getDate() - 1; //日 ,从 Date 对象返回一个月中的某一天 (1 ~ 31)
          var hours = v.getHours(); //小时 ,返回 Date 对象的小时 (0 ~ 23)
          var minutes = v.getMinutes(); //分钟 ,返回 Date 对象的分钟 (0 ~ 59)
          var seconds = v.getSeconds(); //秒 ,返回 Date 对象的秒数 (0 ~ 59)
          //修改月份格式
          if (month >= 1 && month <= 9) {
              month = "0" + month;
          }
          //修改日期格式
          if (day >= 0 && day <= 9) {
              day = "0" + day;
          }
          //修改小时格式
          if (hours >= 0 && hours <= 9) {
              hours = "0" + hours;
          }
          //修改分钟格式
          if (minutes >= 0 && minutes <= 9) {
              minutes = "0" + minutes;
          }
          //修改秒格式
          if (seconds >= 0 && seconds <= 9) {
              seconds = "0" + seconds;
          }
          //格式(yyyy-mm-dd hh:mm:ss)
          var currentFormatDate =
              year +
              "-" +
              month +
              "-" +
              day +
              " " +
              hours +
              ":" +
              minutes +
              ":" +
              seconds;
          return currentFormatDate;
      },
    paperDateBtn() {
      this.detailParams.insuranceStartTime = this.insuranceInfoData.insuranceStartTime
      this.detailParams.insuranceEndTime = this.insuranceInfoData.insuranceEndTime
      savePaperInfo(this.detailParams).then((res) => {
        if (res.code === '0000') {
          this.$Message.success('保险信息更新成功.')
        }
      })
    },
    checkBtn() {
      this.modalTitle = '发票信息（可修改）'
      this.spinShow = true
      getInvoice(this.detailParams).then((res) => {
        if (res.code === '0000') {
          this.checkInvoiceForm = res.data
        }
      })
        this.spinShow = false
        this.checkInvoiceVisible = true
    },
    dropDown() {
      if (this.drop) {
        this.dropDownContent = '点击展开'
        this.dropDownIcon = 'ios-arrow-down'
      } else {
        this.dropDownContent = '点击收起'
        this.dropDownIcon = 'ios-arrow-up'
      }
      this.drop = !this.drop
    },
    financingItemsDropDown() {
      if (this.financingItemsDrop) {
        this.financingItemsDropDownContent = '点击展开'
        this.financingItemsDropDownIcon = 'ios-arrow-down'
      } else {
        this.financingItemsDropDownContent = '点击收起'
        this.financingItemsDropDownIcon = 'ios-arrow-up'
      }
      this.financingItemsDrop = !this.financingItemsDrop
    },
    caseCustDropDown() {
        if (this.caseCustDrop) {
            this.caseCustDropDownContent = '点击展开'
            this.caseCustDropDownIcon = 'ios-arrow-down'
        } else {
            this.caseCustDropDownContent = '点击收起'
            this.caseCustDropDownIcon = 'ios-arrow-up'
        }
        this.caseCustDrop = !this.caseCustDrop
    },
    submitInvoice() {
      if( this.checkInvoiceForm.invoiceDate !=undefined &&
          this.checkInvoiceForm.invoiceDate !=null &&
          this.checkInvoiceForm.invoiceCode !=undefined &&
          this.checkInvoiceForm.invoiceCode !='' &&
          this.checkInvoiceForm.invoiceNumber !=undefined &&
          this.checkInvoiceForm.invoiceNUmber !='' &&
          this.checkInvoiceForm.invoiceAmt !=undefined &&
          this.checkInvoiceForm.invoiceAmt !=''){
          var y = this.checkInvoiceForm.invoiceDate.getFullYear()
          var m = this.checkInvoiceForm.invoiceDate.getMonth() + 1
          var d = this.checkInvoiceForm.invoiceDate.getDate()
          this.checkInvoiceForm.billingDatas =
              y + '' + (m < 10 ? '0' + m : m) + '' + (d < 10 ? '0' + d : d)
          this.checkInvoiceForm.machinePrintedCode = this.checkInvoiceForm.invoiceCode
          this.checkInvoiceForm.machineNumber = this.checkInvoiceForm.invoiceNumber
          this.checkInvoiceForm.totalPriceTax = "¥"+ this.checkInvoiceForm.invoiceAmt
          this.checkInvoiceForm.applyNo = this.detailParams.applyNo
          getInvoiceCheck(this.checkInvoiceForm).then((res) => {
              this.getOcrResult()
              this.checkInvoiceVisible = false
              this.checkInvoiceForm = {}
          })
      } else {
          this.$Message.warning("输入信息不全！")
      }
    },
      getOcrResult(){
          getOcrResult(this.detailParams).then(res=>{
              res.data.forEach(data=>{
                  if( data.ocrType != undefined &&
                      data.ocrType != null &&
                      data.ocrType == 'standardDocumentVehicleInvoice'){
                      data.checkType = '发票校验',
                      this.ocrData.splice(0,1,data)
                  }
                  if( data.ocrType != undefined &&
                      data.ocrType != null &&
                      data.ocrType == 'idCard'){
                      data.checkType = '还款人身份证',
                      this.ocrData.splice(1,1,data)
                  }
                  if( data.ocrType != undefined &&
                      data.ocrType != null &&
                      data.ocrType == 'bankCard'){
                      data.checkType = '还款人银行卡',
                      this.ocrData.splice(2,1,data)
                  }
              })
          })
      },
    cancelInvoice() {
      this.checkInvoiceForm = {}
      this.checkInvoiceVisible = false
    },
    lookMainInImage(row){
        console.log("测试主借人",this.detailParams.contractNo)
        this.isView = true
        this.imageModalVisible=true
        this.busiNo=this.detailParams.contractNo
        this.belongNo=this.detailParams.contractNo
        this.uniqueCodes="mainBorrowerIdcardFront,mainBorrowerIdcardBack"
    },
      lookJoinInImage(row){
          console.log("测试共借人",this.detailParams.contractNo)
          this.isView = true
          this.imageModalVisible=true
          this.busiNo=this.detailParams.contractNo
          this.belongNo=this.detailParams.contractNo
          this.uniqueCodes="comBorrowerIdcardFront,comBorrowerIdcardBack"
      }
  },
  mounted() {
    this.initSelectData();
    this.getAddressTree();
    this.initAllData();
    this.getOcrResult();
  },
}
</script>
<style lang="less">
.auditClass {
  width: 99%;
  height: 100%;
    .ivu-form-item {
        margin-bottom: 0;
    }
}
.auditClass .parent-div {
  width: 100%;
  height: 100%;
}
.auditClass .child-div {
  width: 25%;
  float: left;
}
.auditClass .long-child-div {
  width: 50%;
  float: left;
}
.auditClass .ivu-card-body::after {
  content: '';
  display: block;
  clear: both;
}
.auditClass .hrClass {
  border: 0px;
  background-color: rgb(238, 236, 236);
  height: 2px;
}
.ivu-table-small td {
    height: 30px;
}
</style>
